<?php if ( !defined( 'CMS_ROOT' ) )
	die; ?>


<form id="userEditForm" class="reg_users"  class="form" action="" method="post">
	Все поля обязательны для заполнения.
	<table	class="registration">

		<tr>
			<td>
				<span class="large">E-mail:</span>
			</td>
			<td>
				<input type="text" name="user[email]" value="<? if ( isset( $_POST['user']['email'] ) )
	echo $_POST['user']['email']; ?>" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Пароль:</span>
			</td>
			<td>
				<input type="password" name="user[password]" value="" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Подтверждение пароля:</span>
			</td>
			<td>
				<input type="password" name="user[confirm]" value="" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Фамилия:</span>
			</td>
			<td>
				<input type="text" name="user_extend[name][last]" value="<? if ( isset( $_POST['user_extend']['name']['last'] ) )
						   echo $_POST['user_extend']['name']['last']; ?>" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Имя:</span>
			</td>
			<td>
				<input type="text" name="user_extend[name][first]" value="<? if ( isset( $_POST['user_extend']['name']['first'] ) )
						   echo $_POST['user_extend']['name']['first']; ?>" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Отчество:</span>
			</td>
			<td>
				<input type="text" name="user_extend[name][second]" value="<? if ( isset( $_POST['user_extend']['name']['second'] ) )
						   echo $_POST['user_extend']['name']['second']; ?>" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Контактный телефон:</span>
			</td>
			<td>
				<input type="text" name="user_extend[phone]" value="<? if ( isset( $_POST['user_extend']['phone'] ) )
						   echo $_POST['user_extend']['phone']; ?>" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Дата рождения:</span>
			</td>
			<td>
				Год:
				<select name="user_extend[birthday][year]" style="width: 60px;">
					<?
					$post_year = false;
					if ( isset( $_POST['user_extend']['birthday']['year'] ) )
						$post_year = $_POST['user_extend']['birthday']['year'];

					$year = (int) date( 'Y' );
					$year = $year - 18;
					for ( $i = 60; $i > 0; $i-- )
					{
						if ( $post_year && $post_year == $year )
							echo '<option selected>' . $year . '</option>';
						else
							echo '<option>' . $year . '</option>';

						$year--;
					}
					?>
				</select>
				&nbsp;&nbsp;&nbsp; Месяц: 
				<select name="user_extend[birthday][month]" style="width: 40px;">
					<?
					$post_month = false;
					if ( isset( $_POST['user_extend']['birthday']['month'] ) )
						$post_month = $_POST['user_extend']['birthday']['month'];

					for ( $i = 1; $i <= 12; $i++ )
					{
						$k = ($i < 10) ? '0' . $i : $i;

						if ( $post_month && $post_month == $k )
							echo '<option selected>' . $k . '</option>';
						else
							echo '<option>' . $k . '</option>';
					}
					?>
				</select>
				&nbsp;&nbsp;&nbsp;День:
				<select name="user_extend[birthday][day]" style="width: 40px;">
					<?
					$post_day = false;
					if ( isset( $_POST['user_extend']['birthday']['day'] ) )
						$post_day = $_POST['user_extend']['birthday']['day'];

					for ( $i = 1; $i <= 31; $i++ )
					{
						$k = ($i < 10) ? '0' . $i : $i;
						if ( $post_day && $post_day == $k )
							echo '<option selected>' . $k . '</option>';
						else
							echo '<option>' . $k . '</option>';
					}
					?>
				</select>
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Серия и номер паспорта:</span>
			</td>
			<td>
				<input type="text" name="user_extend[passport][number]" value="<? if ( isset( $_POST['user_extend']['passport']['number'] ) )
						echo $_POST['user_extend']['passport']['number']; ?>" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Кем выдан паспорт:</span>
			</td>
			<td>
				<input type="text" name="user_extend[passport][vidan]" value="<? if ( isset( $_POST['user_extend']['passport']['vidan'] ) )
						   echo $_POST['user_extend']['passport']['vidan']; ?>" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Дата выдачи:</span>
			</td>
			<td>
				Год:
				<select name="user_extend[passport][year]" style="width: 60px;">
					<?
					$pass_post_year = false;
					if ( isset( $_POST['user_extend']['passport']['year'] ) )
						$pass_post_year = $_POST['user_extend']['passport']['year'];

					$year = (int) date( 'Y' );
					$year = $year;
					for ( $i = 60; $i > 0; $i-- )
					{
						if ( $pass_post_year && $pass_post_year == $year )
							echo '<option selected>' . $year . '</option>';
						else
							echo '<option>' . $year . '</option>';

						$year--;
					}
					?>
				</select>
				&nbsp;&nbsp;&nbsp; Месяц: 
				<select name="user_extend[passport][month]" style="width: 40px;">
					<?
					$pass_post_month = false;
					if ( isset( $_POST['user_extend']['passport']['month'] ) )
						$pass_post_month = $_POST['user_extend']['passport']['month'];

					for ( $i = 1; $i <= 12; $i++ )
					{
						$k = ($i < 10) ? '0' . $i : $i;

						if ( $pass_post_month && $pass_post_month == $k )
							echo '<option selected>' . $k . '</option>';
						else
							echo '<option>' . $k . '</option>';
					}
					?>
				</select>
				&nbsp;&nbsp;&nbsp;День:
				<select name="user_extend[passport][day]" style="width: 40px;">
					<?
					$pass_post_day = false;
					if ( isset( $_POST['user_extend']['passport']['day'] ) )
						$pass_post_day = $_POST['user_extend']['passport']['day'];

					for ( $i = 1; $i <= 31; $i++ )
					{
						$k = ($i < 10) ? '0' . $i : $i;
						if ( $pass_post_day && $pass_post_day == $k )
							echo '<option selected>' . $k . '</option>';
						else
							echo '<option>' . $k . '</option>';
					}
					?>
				</select>
			</td>
		</tr>
		<tr>
			<td>
				<span class="large">Адрес:</span>
			</td>
			<td>
				<input type="text" name="user_extend[address]" value="<? if ( isset( $_POST['user_extend']['address'] ) )
						echo $_POST['user_extend']['address']; ?>" />
			</td>
		</tr>

		<tr>
			<td>&nbsp;
			</td>
			<td>
			</td>
		</tr>


		<tr>
			<td>

			</td>
			<td>
				<button type="submit" class="enter" >Регистрация</button>
			</td>
		</tr>


	</table>



	<!--
	
			<tr>
				<td>
					<input type="submit" class="enter" value="Войти"/>
				</td>
				<td>
				</td>
			</tr>
		</table>
	
	
	
		<p>
			<label for="userEditUsernameField"><?php echo __( 'Username' ); ?> </label>
			<span><input id="userEditUsernameField" class="input-text" type="text" name="user[username]" maxlength="255" size="50" value="<?php echo $user->username; ?>" /></span>
		</p>
	
		<p>
			<label for="userEditEmailField"><?php echo __( 'E-mail' ); ?></label>
			<span><input id="userEditEmailField" class="input-text" type="text" name="user[email]" maxlength="255" size="50" value="<?php echo $user->email; ?>" /></span>
		</p>
	
		<p>
			<label for="userEdittextField"><?php echo __( 'text' ); ?>  </em></label>
			<span><input id="userEdittextField" class="input-text" type="text" name="user[text]" maxlength="255" size="50" autocomplete="off" /></span>
		</p>
	
		<p>
			<label for="userEditConfirmField"><?php echo __( 'Confirm text' ); ?></label>
			<span><input id="userEdittextField" class="input-text" type="text" name="user[confirm]" maxlength="255" size="50" autocomplete="off" /></span>
		</p>
	
		<div class="box-buttons">
			<button type="submit"><?php echo __( 'Регистрация' ); ?></button>
		</div>
	//-->
</form>


